package com.smasher.weight.unique;

import android.annotation.SuppressLint;
import android.content.Context;

import com.smasher.weight.helper.DeviceUuidFactory;

import java.util.UUID;

/**
 * @author smasher
 */
public class UniqueAndroidId implements UniqueDelegate {

    @Override
    public String getUniqueId(Context context) {
        return getAndroidId(context);
    }


    /**
     * 获得设备的AndroidId
     *
     * @param context 上下文
     * @return 设备的AndroidId
     */
    @SuppressLint("HardwareIds")
    private static String getAndroidId(Context context) {
        DeviceUuidFactory factory = new DeviceUuidFactory(context);
        UUID uuid = factory.getDeviceUuid();
        return uuid.toString();
    }
}
